<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('选择实际工日单价')" />
</head>
<body class="gray-bg">
     <input type="hidden" id="rowIds">
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li class="select-time">
								<label>汇率时间： </label>
								<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
								<span>-</span>
								<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var prefix = ctx + "basic/monthly/rate";
		var types = [[${@dict.getType('currency_type')}]];
        $(function() {
            var options = {
				url: prefix + "/list?from="+[[${currencyType}]],
		        showSearch: false,
		        showRefresh: false,
		        showToggle: false,
		        showColumns: false,
				columns: [{
					field: 'selectItem',
					radio: true
				},
					{
						field: 'id',
						title: 'id',
						visible: false
					},
					{
						field: 'from',
						title: '源头',
						align: 'center',
						formatter: function(value, row, index) {
							return $.table.selectDictLabel(types, value);
						}
					},
					{
						field: 'to',
						title: '目标',
						align: 'center',
						formatter: function(value, row, index) {
							return $.table.selectDictLabel(types, value);
						}
					},
					{
						field: 'price',
						title: '汇率金额'
					},
					{
						field: 'rateDate',
						title: '汇率日期'
					},
					{
						field: 'remark',
						title: '备注'
					}]
            };
            $.table.init(options);
        });
		/* 添加用户-选择用户-提交(回调形式-父页面调用子页面) */
		function getSelections() {
			var price = $.table.selectColumns("price")[0]
			var fromStr= $.table.selectColumns("from")[0]
			var toStr = $.table.selectColumns("to")[0]
			return {"price":price,"fromCurrencyType":fromStr,"toCurrencyType":toStr};
		}
    </script>
</body>
</html>